package com.iman.manjusri.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import org.springframework.stereotype.Service;

import com.iman.manjusri.domain.CourseCountBean;
import com.iman.manjusri.mappers.CourseCountMapper;
import com.iman.manjusri.service.CourseCountService;

@Service
public class CourseCountServiceImpl implements CourseCountService {

	@Inject
    CourseCountMapper  courseCountMapper;
	
	@Override
	public CourseCountBean getCourseCountBeanById(long courseId) {
		Map<String,Object> searchMap = new HashMap<String,Object>();
		searchMap.put("courseId", courseId);
		List<CourseCountBean> courseCountList = courseCountMapper.getCourseCountInfo(searchMap);
		CourseCountBean courseCount = null;
		if(courseCountList != null){
			if(courseCountList.size()>0){
				courseCount = courseCountList.get(0);
			}
		}
		return courseCount;
	}

	

}
